<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title></title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="/frame/layui/css/layui.css"  media="all">
  <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<table class="layui-table" >
  <colgroup>
    <col width="80">
    <col width="260">
    <col width="60">
    <col width="50">
  </colgroup>
  <thead>
    <tr>
      <th >名称</th>
      <th >【ip/域名】</th>
      <th >端口</th>
      <th >操作</th>
    </tr> 
  </thead>
  <tbody>
  	<#if domainList??>
  		<#list domainList as x >
  		  	<tr>
		      <td>${x.name!}</td>
		      <td>${x.ipOrDomain!}</td>
		      <td>${x.port!}</td>
		      <td><button onclick="del('${x.id!}')" class="layui-btn layui-btn-danger">删除</button></td>
		    </tr>
  		</#list>
  	<#else>
	  	<tr>
	      <td colspan="4" style="text-align: center;">暂无数据</td>
	    </tr>
  	</#if>
  </tbody>
</table>
<script type="text/javascript" src="/js/jquery-1.4.4.min.js"></script>
<script src="/frame/layui/lay/dest/layui.all.js" charset="utf-8"></script>
<!-- 模板引擎 -->
<script src="/js/template/template.js" charset="utf-8"></script>
<script src="/js/template/templateUtil.js" charset="utf-8"></script>
<script type="text/javascript">
	function del(domainId){
		$.ajax({
            type: "POST",
            url: "${basePath}/project/delDomain",
            data: {"domainId":domainId},
            dataType: "json",
            success: function(data){
            	if(data.isSuccess){
            		layer.msg(data.message,{time: 500});
            		window.setTimeout(function(){
            			location.reload();
            		},800); 
            	}else{
            		layer.msg(data.message,{time: 3000});
            	}
            },
            error: function(data){
            	layer.msg("网络错误！");
            }
        });
	}
	
	
</script>
</body>
</html>
